<!--
 * @Author: Shususumu
 * @Date: 2020-10-16 11:09:30
 * @LastEditTime: 2020-10-19 11:18:00
 * @FilePath: \campusPTjobs\src\views\order\index.vue
-->
<template>
  <div id="order">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane
        :label="item"
        :name="item"
        v-for="item in nameList"
        :key="item"
      >
        <ordertable ref="msg"></ordertable>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import Ordertable from "./table";
export default {
  data() {
    return {
      activeName: "所有订单",
      nameList: [
        "所有订单",
        "待支付",
        "待派单",
        "待接单",
        "待服务",
        "待确认",
        "已完成",
      ],
    };
  },
  components: {
    Ordertable,
  },
  mounted() {
    this.$refs.msg[0].sendItem(this.activeName);
  },
  methods: {
    handleClick(tab, event) {
      //   console.log(tab, event);
      this.$refs.msg[tab.index].sendItem(this.activeName); //调用子组件中的方法
    },
  },
};
</script>
<style lang="scss" scoped>
#order {
  padding: 18px;
}
</style>